package com.yuzhihao.writejvm.code.a;

import com.yuzhihao.writejvm.code.Operation;
import com.yuzhihao.writejvm.code.StackFrame;
import com.yuzhihao.writejvm.format.FormsEnum;
import com.yuzhihao.writejvm.format.PrintFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * aload_0
 * @author yzh
 * @see <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5.aload_n">jvmdoc</a>
 * @since 2021年12月16日15:32:03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class Aload0 extends Operation {

    private FormsEnum fe = FormsEnum.aload_0;

    private int lindex = 0;

    @Override
    public StackFrame exec(StackFrame frame) {

        return frame;
    }



    @Override
    public String print(String print) {
        return print + PrintFormat.EMPTY + super.index+PrintFormat.COLON+PrintFormat.EMPTY+fe.name()+System.lineSeparator();
    }

}
